cmake_minimum_required(VERSION 3.0)
SET(PROJECT_NAME "Mdb")
project(${PROJECT_NAME})


set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 20)
add_definitions(-DUNICODE -D_UNICODE)
IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
	add_definitions("-DWINDOWS")
	add_definitions("-D_CRT_SECURE_NO_WARNINGS")
	message("CMAKE_SYSTEM_NAME:" ${CMAKE_SYSTEM_NAME})
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
	add_definitions("-DLINUX")
	message("CMAKE_SYSTEM_NAME:" ${CMAKE_SYSTEM_NAME})
ENDIF()
message("CMAKE_CL_64:" ${CMAKE_CL_64})

macro(add_file name dir filename)
	include_directories(${dir})
	file(GLOB_RECURSE fullname ${dir}/${filename})
	source_group(${name} FILES ${fullname})
	set(all_file ${all_file} ${fullname})
endmacro(add_file)

macro(add_package name dir)
	include_directories(${dir})
	set(hfind ${ARGV1})
	string(APPEND hfind "/*.h")
	set(cppfind ${ARGV1})
	string(APPEND cppfind "/*.cpp")
	set(cfind ${ARGV1})
	string(APPEND cfind "/*.c")
	file(GLOB_RECURSE name_header ${hfind})
	file(GLOB_RECURSE name_cpp ${cppfind})
	file(GLOB_RECURSE name_c ${cfind})
	source_group(${ARGV0} FILES ${name_header} ${name_cpp} ${name_c})
	set(all_file ${all_file} ${name_header} ${name_cpp} ${name_c})
endmacro(add_package)

macro(add_res_package name dir)
	include_directories(${dir})
	set(resfind ${ARGV1})
	string(APPEND resfind "/*")
	file(GLOB_RECURSE res ${resfind})
	source_group(${ARGV0} FILES ${res})
	set(all_file ${all_file} ${res})
endmacro(add_res_package)

macro(include_package name dir)
	include_directories(${dir})
	set(hfind ${ARGV1})
	string(APPEND hfind "/*.h")
	file(GLOB_RECURSE name_header ${hfind})
	source_group(${ARGV0} FILES ${name_header})
	set(all_file ${all_file} ${name_header})
endmacro(include_package)

#add_subdirectory(Target)
add_subdirectory(Test)
